Skip to content

Add RTL localization skill to themes catalog - #122

Open
kevintann11 wants to merge 2 commits into
Fluid-WeCommerce:mainfrom
kevintann11:kevin/add-rtl-localization-skill
Open

Add RTL localization skill to themes catalog#122
kevintann11 wants to merge 2 commits into
Fluid-WeCommerce:mainfrom
kevintann11:kevin/add-rtl-localization-skill

Conversation

@kevintann11

Copy link
Copy Markdown

What

Adds a new RTL localization skill under themes/ for making a Fluid storefront render right-to-left for an RTL-language market (Arabic, Hebrew, Persian/Farsi, Urdu, and other RTL scripts).

This complements the existing translating-theme-languages skill: that one translates copy, this one handles layout direction.

How it works

Approach A — direction-aware, no duplicated markup:

  1. Detect direction — language → direction via a bundled map (keyed on language, not country). Non-RTL languages stop early; vertical/CJK is explicitly out of scope.
  2. Direction-aware theme — set dir from the active locale, convert physical CSS to logical properties so the layout mirrors automatically.
  3. Special sections — hand-fix the components logical CSS can't flip (carousels, directional icons, image/text splits, breadcrumbs, hardcoded positions) and keep numbers/prices/URLs LTR (bidi).
    4-5. Per-country variant (optional) — clone the template and bind it to a country with a region rule.
  4. SEO — sitemap visibility + language hreflang, with the known per-country indexing limitation flagged honestly.

Everything runs against the exposed public API (/api/application_theme_templates, /api/theme_region_rules, /api/v2025-06/sitemap) using {{company.api_base}}.

Files

  • themes/rtl-localization/SKILL.md
  • themes/rtl-localization/references/direction-map.md — the RTL language set
  • themes/rtl-localization/references/special-sections.md — exception-component checklist + bidi
  • themes/rtl-localization/references/fluid.md — the exposed API endpoints, params, scopes
  • manifest.json — registered the skill + its references

Validation

python3 scripts/validate_catalog.py and python3 -m unittest discover -s scripts -p 'test_*.py' both pass locally (43 skills, 7 workflows).

🤖 Generated with Claude Code

kevintann11 and others added 2 commits July 31, 2026 14:23
Adds themes/rtl-localization: a public-facing skill for making a
storefront render right-to-left for an RTL-language market (Arabic,
Hebrew, Persian, Urdu). It sets dir from the active locale, converts
CSS to logical properties, hand-fixes direction-encoding components
(carousels, icons, image/text splits, breadcrumbs), and can serve a
per-country RTL template via the exposed theme-template and
region-rule APIs. Registered in manifest.json with its three
reference files.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… flow

Corrects the skill after review:
- Targets file-based themes only (shared layouts/theme.liquid + sections/*),
  not the API template clone — guessing the surface risked orphan templates.
- Layout localization (dir + CSS logical properties on the shared theme) is
  the invariant that always runs; mirroring never copies sections.
- Adds a Phase 0 interactive flow that asks the user same-content-mirrored vs
  different-content instead of assuming; a variant template is created only
  when different content is explicitly requested, and it reuses shared sections.
- Updates the manifest description to match.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant